﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOABLL;
using TarreOA.TarreOAModels;

public partial class Flow_Info_WorkFormShow : System.Web.UI.Page {
    public string form_model;
    public string form_view;
    public List<Flow_WorkFeedBack> list_feed;
    public List<Flow_WorkProcess> list;
    public List<Flow_WorkProcess> left_list = new List<Flow_WorkProcess>();

    protected void Page_Load(object sender, EventArgs e)
    {
        // if(!Page.IsPostBack) {
        Request.QueryString.Get("WR_ID");
        if(Request.QueryString.Get("WR_ID") != null)
        {
            if(Request.QueryString.Get("VI_ST") == null)
            {
                form_view = "LIN";
            }
            else
            {
                form_view = Request.QueryString.Get("VI_ST");
            }
            int work_id = int.Parse(Request.QueryString.Get("WR_ID"));
            Flow_WorkProcessData_Service fwpd_service = new Flow_WorkProcessData_Service();
            form_model = fwpd_service.FindWorkFormShow(work_id).ToString();
            Flow_WorkProcess_Service fwp_service = new Flow_WorkProcess_Service();
            list = fwp_service.FindCurrentOpState(work_id);
            Flow_WorkFeedBack_Service fwfb_service = new Flow_WorkFeedBack_Service();
            list_feed = fwfb_service.FindAllByWorkId(work_id);
            int i = 0;
            foreach(Flow_WorkProcess fwf in list)
            {
                if(i > 0)
                {
                    if(fwf.Step_id != list[i - 1].Step_id)
                    {
                        left_list.Add(fwf);
                    }
                }
                else
                {
                    left_list.Add(fwf);
                }
                i++;
            }
        }
        //}
    }
}
